<%@page import="com.mvc.config.ApplicationConfig"%>
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ include file="/pages/common/header.jsp"%>
<%@page import="com.mvc.framework.config.GlobalConfig"%>
<title><%=ApplicationConfig.getSystemName() %>-<%=ApplicationConfig.getShortName() %></title>
<jdf:themeFile file="jquery-1.7.2.min.js" />
<jdf:themeFile file="validation/jquery.validationEngine.js" />
<jdf:themeFile file="validation/jquery.validationEngine-cn.js" />
<jdf:themeFile file="validationEngine.jquery.css" />
<jdf:themeFile file="login.css" />
	<link rel="shortcut icon" href="<jdf:theme/>/images/favicon.ico" type="image/x-icon" />
       <script type="text/javascript">
       
       if(window.location.href.indexOf("<%=GlobalConfig.getLoginUrl()%>")==-1){
           window.location = "<%=GlobalConfig.getLoginUrl()%>";
       }

       $(document).ready(function(){
           $("#login-form").validationEngine('attach');
           $('#j_username').focus();
       });
       
       function changeColor(ele){
           ele.style.color='blue';
       }
       
       function checkInput(ele){
           ele.style.color='orange';
       }
       </script>
   </head>
   <body>
       <div id="container">
       	<div class="logo"></div>
       	<div class="system"><h2><%=ApplicationConfig.getShortName() %></h2></div>
       	<div class="linkArea">
	        <p>网址：<a href="http://<%=ApplicationConfig.getWebSite() %>" target="_blank"><%=ApplicationConfig.getWebSite() %></a></p>
	        <p>电话：<%=ApplicationConfig.getTelephone() %></p>
	        <p>邮箱：<a href="mailto:<%=ApplicationConfig.getEmail() %>"><%=ApplicationConfig.getEmail() %></a></p>
       	</div>
       	<div id="login-content">
            <form id="login-form" action="${dynamicDomain}/login" method="post" onsubmit="javascript:$('#loading').show();">
	       		<div style="padding: 5px 0;">
                <c:if test="${not empty message }">
                    <div id="valiationError" class="error">
                        ${message}
                    </div>
                </c:if>
                </div>
	       		<div class="form-row">
	       			<label>用户名： </label>
	       			<span><input class="validate[required]" id="j_username" name="loginName" type="text"/></span>
	       		</div>
	       		<div class="form-row">
	       			<label>密 &nbsp;&nbsp;码： </label>
	       			<span><input class="validate[required]" id="j_password" name="password" type="password" /></span>
	       		</div>
	       		<div class="form-row">
                    <label>验证码： </label>
                    <span><input type="text" name="s_randomCode" id="s_randomCode" maxlength="4" onblur="checkInput(this)" onfocus="changeColor(this)" style="width: 52px;" class="validate[required]">
                                &nbsp;&nbsp;<img src="<%=dynamicDomain%>/randomCode?date=<%=System.currentTimeMillis() %>" class="authCode"></span>
                </div>
	       		<div class="form-row" style="padding:3px;">
	       			<span style="padding-left:180px;">
	       				<button type="submit" id="loginButton" class="no_process">登录</button>
	       			</span>
	       			<span id="loading" style="padding-left:5px;visibility:hidden;">
	       				<img style="vertical-align:middle;" src="<jdf:theme/>/images/saving.gif" />
	       			</span>
	       		</div>
	       		<div style="padding: 5px 0;float:left;width:100%;"></div>
       		</form>
       	</div>
       </div>
   </body>
</html>